package com.fpost.dao;

import com.fpost.dao.impl.ArticleDAO;
import com.fpost.dao.impl.UserDAO;

//Abstract class DAO Factory
public abstract class DAOFactory {

// List of DAO types supported by the factory
public static final int ORACLE = 1;
public static final int SYBASE = 2;

// There will be a method for each DAO that can be 
// created. The concrete factories will have to 
// implement these methods.
public abstract UserDAO getUserDAO();
public abstract ArticleDAO getArticleDAO();

public static DAOFactory getDAOFactory(int factory) {

 switch (factory) {
   
   case ORACLE    : 
       return new OracleDAOFactory();      
   case SYBASE    : 
       return new SybaseDAOFactory();
   
   default           : 
       return null;
 }
}
}
